<!-- 用户中心父组件 -->
<template>
    <el-row class="tac">
        <el-col :span="4" style="margin-left: 20px;">
            <el-menu default-active="5" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose">
                <el-menu-item index="1" @click="gotoLearningRecord">
                    <span>学习记录</span>
                </el-menu-item>
                <el-menu-item index="2" @click="gotopurchaseRecord">
                    <span>购买记录</span>
                </el-menu-item>
                <el-menu-item index="3" @click="gotoMyPost">
                    <span>我的贴子</span>
                </el-menu-item>
                <el-menu-item index="4" @click="gotoMyCollect">
                    <span>我的收藏</span>
                </el-menu-item>
                <el-menu-item index="5" @click="gotoUpdateData">
                    <span>个人资料</span>
                </el-menu-item>
                <el-menu-item index="6" @click="gotoupdatePassword">
                    <span>修改密码</span>
                </el-menu-item>
                <el-menu-item index="7" @click="gotoupdatePhone">
                    <span>其他设置</span>
                </el-menu-item>
            </el-menu>
        </el-col>
        <el-row style="margin-left: 20px;background-color: white;padding-right: 40px;">

            <div style="width: 900px;">
                <RouterView style="margin-left: 20px; margin-top: 20px;"/>
            </div>

        </el-row>
    </el-row>
</template>

<script setup>

import {
    Document,
    Menu as IconMenu,
    Location,
    Setting,
} from '@element-plus/icons-vue'

//路由============================
import { useRouter } from 'vue-router';
const router = useRouter();
function gotoupdatePassword(){
    router.push('/updatePassword')
}

function gotoupdatePhone(){
    router.push('/updatePhone')
}

function gotoMyPost(){
    router.push('/myPost')
}

function gotopurchaseRecord(){
    router.push('/purchaseRecord')
}

function gotoMyCollect(){
    router.push('/myCollect')
}

function gotoLearningRecord(){
    router.push('/learningRecord')
}

function gotoUpdateData(){
    router.push('/updateUserData')
}

//===============================
const handleOpen = (key, keyPath) => {
    console.log(key, keyPath)
}
const handleClose = (key, keyPath) => {
    console.log(key, keyPath)
}

</script>
<style scoped></style>